#ifndef _SK_COMMON_H_
#define _SK_COMMON_H_


#include "sk_types.h"
#include "mem/sk_mem.h"
#include "util/sk_string.h"

//basic
//////////////////////////////////////////////////////////////////////////
#define SK_NULL 0
#define TRUE 1
#define FALSE 0
#define SIZEOF(a) sizeof(a)
#define SAFE_FREE(v) if(v){SK_MEM_free(v); v=SK_NULL;}
#define ABS(v) ((v)>0?(v):(-v))
#define SWAP(T,a,b) {T t = a; a = b; b = t;}
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)>(b)?(b):(a))
#define ELEMENT_OF(o) (SIZEOF(o) / SIZEOF(o[0]))

#ifdef WIN32_PC
#define SKT(a) _T(a)
#endif
//extends
//////////////////////////////////////////////////////////////////////////
#define MAX_ALPHA_VALUE 255
#define SK_U322COLOR(u32,pcolor) \
	pcolor->m_r = (u32 & 0x00ff0000) >> 16; \
	pcolor->m_g = (u32 & 0x0000ff00) >> 8; \
	pcolor->m_b = (u32 & 0x000000ff); 

#endif